﻿using System;
using System.Windows.Forms;

namespace view
{
    public partial class Main : Form
    {

        public LandingPage landingPage;
        public LoginPage loginPage;
        public PrinterConfig printerConfig;

        [Obsolete]
        public Main()
        {

            InitializeComponent();

            this.StartPosition = FormStartPosition.CenterScreen;
            this.landingPage = new LandingPage();
            this.loginPage = new LoginPage(this);
            this.printerConfig = new PrinterConfig();

            this.showLandingPage();
            this.timer1.Enabled = true;
            this.timer1.Interval = 3000;
            this.timer1.Start();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void groupBox1_Enter(object sender, EventArgs e)
        {

        }


        private void timer1_Tick(object sender, EventArgs e)
        {
            this.showLoginPage();
            this.timer1.Enabled = false;
        }

        public void showLandingPage()
        {
            this.landingPage.Show();
            this.groupBox1.Controls.Clear();
            this.groupBox1.Controls.Add(this.landingPage);
        }

        public void showLoginPage()
        {
            this.loginPage.Show();
            this.groupBox1.Controls.Clear();
            this.groupBox1.Controls.Add(this.loginPage);
        }

        public void showPrintConfig(String license)
        {
            this.printerConfig.license = license;
            this.printerConfig.Show();
            this.groupBox1.Controls.Clear();
            this.groupBox1.Controls.Add(this.printerConfig);
        }
    }
}
